new Vue({
    el: '#app',
    data: {
        //控制左边菜单
        offLeftMenu: true,
        //控制添加地址按钮显示隐藏
        showBtn: true,
        heaIconJson: {
            left: './static/img/icon-list.png',
            middle: "<span style='text-align:center;font-size:32px;'>地址管理</span>",
            right1: './static/img/icon-car.png',
            right2: './static/img/icon-shopping.png'
        }
    },
    methods: {
        right1: function() {
            window.location.href = HREF + 'my-shopping-car.html';
        },
        right2: function() {
            window.location.href = HREF + 'index.html';
        },
        //打开添加地址的小按钮
        openBtn: function() {
            var el = $('.small-btn');
            this.showBtn ? el.css('transform', 'translateX(-110px)') : el.css('transform', 'translateX(0)');
            this.showBtn = !this.showBtn;
        },
        //添加地址
        addAddress: function() {
            console.log('添加地址')
        },
        //编辑地址
        editAddress: function(val) {
            alert('编辑地址+' + val);
        },
        //删除地址
        delAddress: function(val) {
            alert('删除地址+' + val);
        }
    }
});